const merge = require('webpack-merge');
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
// const BrowserSyncPlugin = require('browser-sync-webpack-plugin');
// const ExtractPlugin = require('extract-text-webpack-plugin');
const common = require('./webpack.config.js');
module.exports = merge(common, {
    output: {
        path:  "/",
        filename: '[name].[hash:8].js',
        publicPath: '/'
    },
    devServer: {//webpack-server的配置
        contentBase: path.join(__dirname, "/"),
        historyApiFallback: false,
        inline: true,
        host: 'localhost',
        port: 1090,
        open: true,
        inline: true,
        historyApiFallback: true,
        hot:true,
        compress:true,
        proxy: {
            "/health": {
                // http://md.kexinkang.com/health
                // target: "http://47.112.141.28:10001",
                target: "http://md.kexinkang.com",
                changeOrigin: true,
            },
        }
    },
    plugins: [
        new HtmlWebpackPlugin({
            title: '慢病管理云平台',
            template: path.join(__dirname, 'index.html'),
            filename: 'index.html',
            chunks: ['main'],
            // chunks: ["index"],
            inject: 'body',
        })
    ],
    devtool: 'inline-source-map'
});